﻿// INGENIOUS FRAMEWORK - Semantic Web Development Simplified
// Copyright (C) 2012 Linked Data Tools

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;

using Ingenious.GraphStore;
using Ingenious.Core;
using System.Threading;
using Ingenious.Utility;

namespace Ingenious.Graph
{
    /// <summary>
    /// The default serialization provider is a MongoDB provider
    /// </summary>
    public class MongoGraphProxy : GraphProxy<ObjectId>
    {       
        #region Object Lifetime
        static MongoGraphProxy()
        {
            BsonClassMap.RegisterClassMap<Triple>(cm =>
            {
                cm.AutoMap();
                cm.UnmapProperty("LiteralType");
            });

            BsonClassMap.RegisterClassMap<Triple<ObjectId>>(cm =>
            {
                cm.AutoMap();
                cm.SetIdMember(cm.GetMemberMap(c => c.ID));
            });
        }

        public MongoGraphProxy()
        {
        }

        public MongoGraphProxy(FetchMode implicitFetchMode)
            : base(implicitFetchMode)
        {
        }

        public MongoGraphProxy(FetchMode implicitFetchMode, SynchronizationContext synchronizationContext)
            : base(implicitFetchMode, synchronizationContext)
        {
        }
        #endregion        
    }
}
